/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UpdateIssueForm.java
 *
 * Created on Oct 5, 2011, 4:25:31 PM
 */
package redclient.ui;

import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import redclient.Items.Issue;

/**
 *
 * @author Isaias
 */
public class UpdateIssueForm extends javax.swing.JFrame {

    /** Creates new form UpdateIssueForm */
    public UpdateIssueForm() {
        initComponents();
    }
    
    private Issue issue;
    
    public UpdateIssueForm(Issue issue)
    {
        this.issue = issue;
        initComponents(issue);
    }

    private void initComponents(Issue issue)
    {
        initComponents();
        Container contentPane = this.getContentPane();
        contentPane.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 0;
        c.gridy = 0;
        c.insets = new Insets(5,5,15,5);
        contentPane.add(new JLabel("Files"), c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 7;
        c.gridy = 0;
        c.insets = new Insets(5,5,15,5);
        JButton btnAddNew = new JButton("Add another file");
        contentPane.add(btnAddNew, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 8;
        c.gridy = 0;
        c.insets = new Insets(5,5,15,5);
        JButton btnOk = new JButton("OK");
        contentPane.add(btnOk, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 9;
        c.gridy = 0;
        c.insets = new Insets(5,5,15,5);
        JButton btnCancel = new JButton("Cancel");
        contentPane.add(btnCancel, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5,5,5,5);
        c.gridx = 0;
        c.gridwidth = 3;
        c.gridy = 2;
        JTextField fileName = new JTextField("", 40);
        fileName.setName("path");
        contentPane.add(fileName, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5,5,5,5);
        c.gridx = 3;
        c.gridy = 2;
        c.gridwidth = 1;
        JButton btnFile = new JButton("File");
        contentPane.add(btnFile, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5,5,5,5);
        c.gridx = 4;
        c.gridy = 2;
        c.gridwidth = 2;
        contentPane.add(new JLabel("Optional description"), c);
        
                
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5,5,5,5);
        c.gridx = 6;
        c.gridy = 2;
        c.gridwidth = 4;
        contentPane.add(new JTextField("", 40), c);
        this.pack();
        
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(null);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new UpdateIssueForm().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
